package com.aggron.concurrency.examples.publish;

import com.aggron.concurrency.annotations.NotThreadSafe;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;

/**
 * @author LR2SD
 * @description 不安全的发布对象
 * @date 2018-06-10 14:50
 */
@Slf4j
@NotThreadSafe
public class UnSafePublish {

    private String [] status={"a","b","c"};

    public String [] getStatus(){
        return status;
    }

    public static void main(String [] args){
        UnSafePublish unSafePublish=new UnSafePublish();
        log.info(Arrays.toString(unSafePublish.getStatus()));

        unSafePublish.getStatus()[0]="d";
        log.info(Arrays.toString(unSafePublish.getStatus()));
    }
}
